/* 全局样式 */
body {
    background-color: #f0f8ff; /* 淡蓝色背景 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* 顶部导航栏 */
.header {
    background-color: #336699; /* 深蓝色导航栏 */
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.header .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    flex-grow: 1;
    max-width: 500px;
}

.header .search-box button {
    padding: 8px 25px;
    background-color: #ff9900; /* 橙色搜索按钮 */
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.header .search-box button:hover {
    background-color: #e58300;
}

.header .nav a {
    color: white;
    margin-left: 20px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

/* 轮播图 */
.slider {
    height: 500px; /* 高高度 */
    margin: 20px 0;
    overflow: hidden;
}

.slides {
    display: flex;
    width: 300%;
    animation: slide 15s infinite; /* 慢动画 */
}

.slides img {
    width: 33.33%;
    height: 500px;
    object-fit: cover;
}

@keyframes slide {
    0% { transform: translateX(0); }
    33% { transform: translateX(-33.33%); }
    66% { transform: translateX(-66.66%); }
    100% { transform: translateX(0); }
}

/* 商品分类 */
.categories {
    padding: 40px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    margin: 0 20px 30px;
}

.categories h2 {
    font-size: 32px; /* 大标题 */
    color: #336699;
    margin-bottom: 30px;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.category-item {
    width: 180px; /* 适中尺寸 */
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    transition: all 0.3s;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.category-item p {
    font-size: 18px;
    color: #333;
    margin: 0;
}

/* 商品列表 */
.products {
    padding: 40px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    margin: 0 20px 30px;
}

.products h2 {
    font-size: 32px;
    color: #336699;
    margin-bottom: 30px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列布局 */
    gap: 30px;
}

.product-card {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-img {
    height: 300px; /* 高图片 */
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    text-align: left;
}

.product-title {
    font-size: 20px;
    color: #333;
    margin: 10px 0;
    height: 40px; /* 标题行数控制 */
    overflow: hidden;
}

.product-price {
    color: #ff9900;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    padding: 12px;
    background-color: #ff9900;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.add-to-cart:hover {
    background-color: #e58300;
}

/* 页脚 */
.footer {
    background-color: #336699;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

.footer p {
    font-size: 16px;
    margin: 0;
}